import request from '@/utils/request'
// 封装登录请求方法
export const login = function (data) {
  return request.post('/user/login', data)
}
// 封装登录请求方法
export const register = function (data) {
  return request.post('/user/registered', data)
}
// 封装找房请求方法
export const find = function () {
  return request.get('houses')
}
// 封装轮播图
export const article = function () {
  return request.get('/home/swiper')
}
export const zhufang = function () {
  return request.get('/home/groups')
}
// 封装详情页
export const housesid = function (id) {
  return request.get('/houses/' + id)
}

export const shouchang = function (id) {
  return request.post('/user/favorites/' + id)
}

export const delcoll = function (id) {
  return request.delete('/user/favorites/' + id)
}
// 封装城市列表请求方法(不需要额外参数)
export const cityList = function () {
  return request.get('/area/city')
}
// 封装图片上传
export const showHouseApi = function () {
  return request.post('/houses/image')
}
// 封装收藏请求
export const ShouCang = function () {
  return request.get('/user/favorites')
}

// 封装搜索出租页面
export const Tosearch = function (name) {
  return request.get('/area/info', { params: { name } })
}
// 封装小区关键词查询
export const Tosearchlist = function (name, id) {
  return request.get('/area/community', { params: { name: name, id: id } })
}
//
export const showHouseApi1 = body => {
  return request.post('/user/houses', body)
}
export const fabu = function () {
  return request.get('/houses/params')
}
